namespace ETestIT.DataAccess
{
    using System;
    using System.Collections.Generic;
    using Domain;
    using Domain.Repositories;
    using Repository;

    public class JobTitleRepositoryImpl : IJobTitleRepository
    {
        public IList<JobTitle> GetAll()
        {
            throw new NotImplementedException();
        }

        public void Add(JobTitle resume)
        {
            throw new NotImplementedException();
        }

        public void Update(JobTitle user)
        {
            throw new NotImplementedException();
        }

        public void Delete(Guid candId)
        {
            throw new NotImplementedException();
        }

        public JobTitle GetById(Guid id)
        {
            const string sql = @"SELECT Id, JobTitle FROM JobTitles WHERE Id = @Id";

            return new FluentCommand<JobTitle>(sql)
                .AddGuid("Id", id)
                .SetMap(JobTitleMap)
                .AsSingle();
        }

        private JobTitle JobTitleMap(DataReader reader)
        {
            return new JobTitle()
                       {
                           Id = reader.GetGuid("Id"),
                           Name = "JobTitle"
                       };
        }
    }
}